package com.example.demo.service.impl;

import com.example.demo.bean.Good;
import com.example.demo.service.BuyStrategy;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @ClassName: CommonBuyStrategy
 * @Description: 正常购买
 * @Author: Administrator
 * @Date: Created in 2022/11/19 15:48
 */
@Service
public class CommonBuyStrategy extends BuyStrategy {

    public BigDecimal calculate(Good good, BigDecimal num) {
        return good.getPrice().multiply(num);
    }
}
